<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{$table.table_name} {$table.table_comment}</title>
    <style>
        body,td,th {font-family:"宋体"; font-size:12px;}
        table{border-collapse:collapse;border:1px solid #CCC;background:#6089D4;margin: 10px auto; }
        table caption{text-align:left; background-color:#fff; line-height:2em; font-size:14px; font-weight:bold; }
        table th{text-align:center; font-weight:bold;height:26px; line-height:25px; font-size:16px; border:3px solid #fff; color:#ffffff; padding:5px;}
        table td{height:25px; font-size:12px; border:3px solid #fff; background-color:#f0f0f0; padding:5px;}
        .c1{ width: 200px; font-weight: bold; padding: 0 10px; font-size: 14px }
        .c2{ width: 130px;}
        .c3{ width: 70px; text-align: center}
        .c4{ width: 80px;text-align: center}
        .c5{ width: 80px;text-align: center}
        .c6{ width: 300px;}
    </style>
</head>
<body>
    <table>
        <caption>{$table.table_name} {$table.table_comment}</caption>
        <tbody>
            <tr>
                <th class="c1">字段名</th>
                <th class="c2">数据类型</th>
                <th class="c3">默认值</th>
                <th class="c4">允许非空</th>
                <th class="c5">属性</th>
                <th class="c6">备注</th>
            </tr>
        </tbody>
        <tbody>
            {foreach $data as $row}
            <tr>
                <td class="c1">{$row.column_name}</td>
                <td class="c2">{$row.column_type}</td>
                <td class="c3">{$row.column_default}</td>
                <td class="c4">{$row.is_nullable}</td>
                <td class="c5">
                    {$row['extra']==='auto_increment'?'自增&nbsp;':''}
                    {switch name="row.column_key" }
                    {case value="PRI"}主键{/case}
                    {case value="UNI"}唯一索引{/case}
                    {case value="MUL"}可重索引{/case}
                    {default /}
                    {/switch}
                </td>
                <td class="c6">{$row.column_comment}</td>
            </tr>
            {/foreach}
        </tbody>
    </table>
</body>
</html>